package com.jwds.digital.bios.business.rpc.feign;

import com.jwds.digital.bios.business.core.infrastructure.dto.feign.BasicMaterialReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.feign.BasicMaterialRespVO;
import com.jwds.digital.bios.business.rpc.feign.fallback.BasicMaterialFeignFallBack;
import com.jwds.digital.bios.business.rpc.feign.fallback.BasicStockBinFallBack;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 物料基本信息Feign
 *
 * @Author hesong
 */
@FeignClient(name = "bios-flow", path = "/basic/material",fallback = BasicMaterialFeignFallBack.class)
public interface BasicMaterialFeign {
    /**
     * 根据id查询
     *
     * @param id 数据ID
     * @return BaseResponse
     */
    @GetMapping("/{id}")
    BaseResponse<BasicMaterialRespVO> queryById(@PathVariable("id") Long id);

    /**
     * 列表查询
     *
     * @param reqDto 查询条件
     * @return BaseResponse
     */
    @PostMapping("/all")
    BaseResponse<List<BasicMaterialRespVO>> list(@RequestBody BasicMaterialReqDTO reqDto);

    /**
     * 新增
     *
     * @param reqDto 实体
     * @return BaseResponse
     */
    @PostMapping("/")
    BaseResponse<?> add(@Validated @RequestBody BasicMaterialReqDTO reqDto);

    /**
     * 批量新增
     *
     * @param reqDtoList 实体集合
     * @return BaseResponse
     */
    @PostMapping("/batch")
    BaseResponse<?> batchAdd(@RequestBody List<BasicMaterialReqDTO> reqDtoList);

    /**
     * 更新对象
     *
     * @param reqDto 实体
     * @return BaseResponse
     */
    @PutMapping("/")
    BaseResponse<?> update(@RequestBody BasicMaterialReqDTO reqDto);

}
